package com.android.zing.api;

import java.util.HashMap;

import android.util.Log;

import com.android.zing.ZME_Base;

public class ZME_Me extends ZME_ASyncGraphAPI{
	private static final String TAG = "ZME_ASyncGraphAPI";
	
	public ZME_Me(ZME_Base zme) {
		super(zme);
	}
	
	public void getInfo( String fields, final RequestListener listener ) {
		Log.d(TAG, ">>>> ZME_Me :: getInfo");
		String endpoint = ZME_Base.GRAPH_BASE_URL + this.ME_INFO_PATH;
		
		HashMap<String, String> params = new HashMap<String, String>();
		params.put("access_token", zme.getAccessToken());
		params.put("fields", fields);
		
		request( endpoint, params, listener );
		
		Log.d(TAG, "<<<< ZME_Me :: getInfo");
	}
	
	public void getFriends( final RequestListener listener ) {
		Log.d(TAG, ">>>> ZME_Me :: getFriends");
		String endpoint = ZME_Base.GRAPH_BASE_URL + this.ME_FRIEND_LIST_PATH;
		
		HashMap<String, String> params = new HashMap<String, String>();
		params.put("access_token", zme.getAccessToken());
		
		request( endpoint, params, listener );
		Log.d(TAG, "<<<< ZME_Me :: getFriends");
	}
	
	public void isFanOf( String zmeUsername, final RequestListener listener ){
		Log.d(TAG, ">>>> ZME_Me :: isFanOf");
		String endpoint = ZME_Base.GRAPH_BASE_URL + this.ME_IS_FAN_OF_PATH;
		
		HashMap<String, String> params = new HashMap<String, String>();
		params.put("access_token", zme.getAccessToken());
		params.put("profile", zmeUsername);
		
		request( endpoint, params, listener );
		Log.d(TAG, "<<<< ZME_Me :: isFanOf");
	}
}
